home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Directorty Opus 5 - Magellan
/
Opus 5 - Magellan.iso
/
Archiv
/
BangerC64opus.lha
/
BangerC64opus.dopus5
next >
Wrap
Text File
|
1996-12-01
|
10KB
|
363 lines
/* Program: BangerC64opus.dopus5 DopusHandle for the Easy1541 Software under Dopus5.5
Autor: Andre´ Trettin
Codename: Banger
Begin: 25-Nov-96
$VER: BangerC64.dopus5 1.0 (25-Nov-96)*/
/* Path for the Software "Easy1541" */
IECPATH='XE1:Emu/Easy1541'
/* Change it! */
parse arg portname UNITNR
if portname='' then portname='DOPUS.1'
if UNITNR='' then UNITNR='8'
if ~show('l','rexxsupport.library') then
call addlib('rexxsupport.library',0,-30,0)
if ~openport('BangerHandler') then exit
address value portname
signal on syntax
options results
options failat 20
lf='0a'x
lister new
handle=result
address command ''IECPATH'/IECDir >T:BangerC64Dir.temp 'UNITNR''
open(1,'T:BangerC64Dir.temp','R')
readln(1)
DISKNAME=delstr(readln(1),1,8)
DISKNAME=delstr(DISKNAME,length(DISKNAME)-12,13)
i=0
do forever
filezeile=readln(1)
if filezeile="" then leave
i=i+1
filezeile=delstr(filezeile,length(filezeile)-5,6)
parse value filezeile with BLOCKS.i '"' NAME.i '"' TYP.i
BLOCKS.i=space(BLOCKS.i,0)
Zahl=BLOCKS.i
if (datatype(Zahl,Numeric)) then Zahl=Zahl*254
BLOCKS.i=Zahl
TYP.i=space(TYP.i,0)
end
close(1)
FREI=BLOCKS.i
FREI=delstr(FREI,length(FREI)-10,11)*254
ANZAHLFILE=i-1
LISTERTITLE=DISKNAME||", "||FREI||" Bytes"
lister set handle title LISTERTITLE
lister set handle sort name
lister set handle busy on
lister set handle progress ANZAHLFILE
lister refresh handle full
do i=1 to ANZAHLFILE
lister query handle abort
if result then leave
lister set handle progress count i
lister set handle progress name NAME.i
lister add handle '"'NAME.i'" "'BLOCKS.i'" -1 0 r 'TYP.i''
lister set handle display name size comment
lister refresh handle full
end
lister set handle busy off
lister refresh handle full
lister set handle handler 'BangerHandler' 'quotes'
dopus addtrap copy 'BangerHandler'
dopus addtrap move 'BangerHandler'
dopus addtrap copyas 'BangerHandler'
dopus addtrap moveas 'BangerHandler'
dopus addtrap delete 'BangerHandler'
dopus addtrap rename 'BangerHandler'
dopus addtrap read 'BangerHandler'
dopus addtrap hexread 'BangerHandler'
dopus addtrap devicelist 'BangerHandler'
dopus addtrap parent 'BangerHandler'
dopus addtrap root 'BangerHandler'
dopus addtrap show 'BangerHandler'
dopus addtrap play 'BangerHandler'
dopus addtrap protect 'BangerHandler'
dopus addtrap datestamp 'BangerHandler'
dopus addtrap comment 'BangerHandler'
dopus addtrap makedir 'BangerHandler'
dopus addtrap addicon 'BangerHandler'
dopus addtrap cachelist 'BangerHandler'
do forever
if waitpkt('BangerHandler') then do
packet=getpkt('BangerHandler')
if packet='00000000'x then iterate
event=getarg(packet,0)
handle=getarg(packet,1)
titel=getarg(packet,2)
user=getarg(packet,3)
pathstr=getarg(packet,4)
if event="Root" then leave
if event="Parent" then leave
if event="parent" then leave
if event="inactive" then leave
select
when event="Copy" then call C64Copy
when event="Move" then call C64Move
when event="CopyAs" then call C64CopyAs
when event="MoveAs" then call C64MoveAs
when event="Delete" then call C64Delete
when event="Rename" then call C64Rename
when event="dropfrom" then call C64Copy
when event="drop" then call C64Save
when event="Read" then call C64Read
when event="doubleclick" then call C64HexRead
when event="HexRead" then call C64HexRead
when event="MakeDir" then call C64MakeDir
when event="Play" then call C64Play
when event="Show" then call C64Show
otherwise call BangerInfo
end
reply(packet,10)
end
end
lister clear handle
lister refresh handle full
lister close handle
dopus remtrap '*' 'BangerHandler'
call closeport('BangerHandler')
address command 'Delete >NIL: T:Banger#?'
exit
/* BangerInfo */
BangerInfo:
Confirm "Banger bringt den C64´er wieder zum laufen!"
Return
/* C64HexRead */
C64HexRead:
if event='doubleclick' then lister select handle '"'titel'"' on
call C64Load
command hexread "T:BangerC64Datei"
return
/* C64Read */
C64Read:
call C64Load
command read "T:BangerC64Datei"
return
/* C64Load */
C64Load:
lister set handle busy on
lister query handle selfiles stem files.
lister set handle progress files.count
lister refresh handle full
do i=0 to files.count-1
titel=files.i
lister set handle progress count i+1
lister set handle progress name titel
lister query handle abort
if result then leave
Zielname="T:BangerC64Datei"
Quellname='"'titel'"'
address command ''IECPATH'/IECLoad >NIL: 'Quellname' 'Zielname' 'UNITNR''
lister select handle '"'titel'"' off
lister refresh handle full
end
lister set handle busy off
return
/* C64Save */
C64Save:
lister set handle busy on
lister set user busy on
if event='drop' then do
temp=user
user=handle
handle=temp
files.count=1
titel=delstr(titel,1,1)
titel=delstr(titel,length(titel),1)
files.0=titel
lister query handle path
pathstr=result
end
else lister query handle selfiles stem files.
lister set handle progress files.count
lister refresh handle full
do i=0 to files.count-1
titel=files.i
lister set handle progress count i+1
lister set handle progress name titel
lister query handle abort
if result then leave
neutitel=titel
Quellname='"'pathstr||titel'"'
if CopyAs_FLAG=1 then do
dopus getstring '"Bitte neuen Namen eingeben" "'neutitel'" OK|Abbruch'
if DOPUSRC=0 then leave
neutitel=result
if neutitel="RESULT" then neutitel=titel
lister set handle progress name neutitel
end
Zielname='"'neutitel'"'
address command ''IECPATH'/IECSave >NIL: 'Quellname' 'Zielname' 'UNITNR''
lister select handle '"'titel'"' off
if Delete_FLAG=1 then do
address command 'delete >NIL: 'Quellname''
lister remove handle '"'titel'"'
lister refresh handle
end
lister refresh handle full
lister query handle entry '"'titel'"' stem datei
lister add user '"'neutitel'" 'datei.size' -1 0 r PRG'
lister refresh user
end
lister set handle busy off
lister set user busy off
lister read handle '"'pathstr'"' force
lister refresh user full
CopyAs_FLAG=0
return
/* C64Rename */
C64Rename:
lister set handle busy on
lister set user busy on
lister query handle selfiles stem files.
lister set handle progress files.count
lister refresh handle full
do i=0 to files.count-1
titel=files.i
lister set handle progress count i+1
lister set handle progress name titel
lister query handle abort
if result then leave
Quellname='"'titel'"'
dopus getstring '"Bitte neuen Namen eingeben" 'Quellname' OK|Abbruch'
if DOPUSRC=0 then leave
neutitel=result
if neutitel="RESULT" then neutitel=titel
lister set handle progress name neutitel
Argumente='"R0:'neutitel'=0:'titel'"'
address command ''IECPATH'/IECCmd >NIL: 'Argumente' 'UNITNR''
lister query handle entry Quellname stem datei
datei.name=neutitel
lister remove handle Quellname
lister add handle '"'datei.name'" 'datei.size' -1 0 r 'datei.comment''
lister refresh handle
lister refresh handle full
end
lister set handle busy off
lister set user busy off
lister refresh user full
return
/* C64Delete */
C64Delete:
lister set handle busy on
lister set user busy on
lister query handle selfiles stem files.
lister set handle progress files.count
lister refresh handle full
do i=0 to files.count-1
titel=files.i
lister set handle progress count i+1
lister set handle progress name titel
lister query handle abort
if result then leave
Argumente='"S0:'titel'"'
address command ''IECPATH'/IECCmd >NIL: 'Argumente' 'UNITNR''
lister remove handle '"'titel'"'
lister refresh handle
lister refresh handle full
end
lister set handle busy off
lister set user busy off
lister refresh user full
return
/* C64CopyAs */
C64CopyAs:
CopyAs_FLAG=1
/* C64Copy */
C64Copy:
if pathstr~="" then call C64Save
else do
lister set handle busy on
lister set user busy on
if event='dropfrom' then do
files.count=1
titel=delstr(titel,1,1)
titel=delstr(titel,length(titel),1)
files.0=titel
end
else lister query handle selfiles stem files.
lister set handle progress files.count
lister refresh handle full
lister query user path
Zielpfad=result
do i=0 to files.count-1
titel=files.i
lister set handle progress count i+1
lister set handle progress name titel
lister query handle abort
if result then leave
neutitel=titel
Quellname='"'titel'"'
if CopyAs_FLAG=1 then do
dopus getstring '"Bitte neuen Namen eingeben" 'Quellname' OK|Abbruch'
if DOPUSRC=0 then leave
neutitel=result
if neutitel="RESULT" then neutitel=titel
lister set handle progress name neutitel
end
Zielname='"'Zielpfad||neutitel'"'
address command ''IECPATH'/IECLoad >NIL: 'Quellname' 'Zielname' 'UNITNR''
lister select handle '"'titel'"' off
if Delete_FLAG=1 then do
Argumente='"S0:'titel'"'
address command ''IECPATH'/IECCmd >NIL: 'Argumente' 'UNITNR''
lister remove handle '"'titel'"'
lister refresh handle
end
lister refresh handle full
end
lister set handle busy off
lister set user busy off
lister read user '"'Zielpfad'"' force
lister refresh user full
CopyAs_FLAG=0
end
return
/* C64MoveAs */
C64MoveAs:
Delete_FLAG=1
call C64CopyAs
Delete_FLAG=0
return
/* C64Move */
C64Move:
Delete_FLAG=1
call C64Copy
Delete_FLAG=0
return
/* Wird später noch eingefügt */
C64MakeDir:
C64Play:
C64Show:
return
syntax:
SAY "error at line" SIGL ":" RC
Return